package cn.ynrcb.personnelfile.sysadmin.service.impl;

import cn.hutool.core.convert.Convert;
import cn.ynrcb.personnelfile.common.utils.PageUtils;
import cn.ynrcb.personnelfile.sysadmin.dao.SysLogDao;
import cn.ynrcb.personnelfile.sysadmin.entity.SysLogEntity;
import cn.ynrcb.personnelfile.sysadmin.service.SysLogService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("sysLogService")
public class SysLogServiceImpl extends ServiceImpl<SysLogDao, SysLogEntity> implements SysLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
    	Page<SysLogEntity> page = new Page<SysLogEntity>(Convert.toLong(params.get("page") + "",1L), Convert.toLong(params.get("limit")+"",12L));
    	List<SysLogEntity> list = baseMapper.queryPage(page, params);
    	page.setRecords(list);
        return new PageUtils((IPage<?>) page);
    }
}
